<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
    require_once( dirname(__FILE__) . '/../components/helpers.php');
    define('PRODUCTION_SERVER', 1);
    return array(
        'basePath'  => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
        'name'      => 'Customer Connect 2012',
        // preloading 'log' component
        'preload'   => array('log'),
        // autoloading model and component classes
        'import'    => array(
            'application.models.*',
            'application.components.*',
            'application.utils.*',
            'application.utils.pdf.*',
            'application.utils.contract.*',
            'application.forms.*',
        ),
//        'behaviors' => array(
//            'onBeginRequest' => array(
//                'class' => 'application.components.Forcehttps'
//            )
//        ),
        'modules' => array(
            // uncomment the following to enable the Gii tool
            'vendors',
            'report',
            'companyinfo',
            'customerportal',
            'salespersonportal',
            'gii' => array(
                'class'     => 'system.gii.GiiModule',
                'password'  => 'adamc',
                // If removed, Gii defaults to localhost only. Edit carefully to taste.
                'ipFilters' => array('127.0.0.1', '::1', '65.118.19.130'),
            ),
            'srbac' => array(
                'userclass'     => 'Users',
                'userid'        => 'id',
                'username'      => 'real_name',
                'delimeter'     => '@',
                'debug'         => true,
                'pageSize'      => 10,
                'superUser'     => 'Authority',
                'iconText'      => true,
                'showHeader'    => true,
                'showFooter'    => true,
            ),
        ),
        // application components
        'components' => array(            
            'fileHelper' => array(
                'class' => 'ext.filehelper.FileHelper',
            ),
            'swiftMailer' => array(
                'class' => 'ext.swiftMailer.SwiftMailer',
            ),
            'authManager' => array(
                'class'             => 'srbac.components.SDbAuthManager',
                'connectionID'      => 'db',
                'itemTable'         => 'tbl_items',
                'assignmentTable'   => 'tbl_assignments',
                'itemChildTable'    => 'tbl_itemchildren',
            ),
            'simpleImage' => array(
                'class' => 'application.extensions.CSimpleImage',
            ),
            'user' => array(
                // enable cookie-based authentication
                'allowAutoLogin'    => true,
                'class'             => 'application.components.WebUser'
            ),
            // uncomment the following to enable URLs in path-format
            /*
              'urlManager'=>array(
              'urlFormat'=>'path',
              'rules'=>array(
              '<controller:\w+>/<id:\d+>'=>'<controller>/view',
              '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
              '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
              ),
              ),
             */
            /*
              'db'=>array(
              'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
              ),
             */
            // uncomment the following to use a MySQL database
            'dbqsilive' => array(
                'class'                 => 'application.extensions.PHPPDO.CPdoDbConnection',
                'pdoClass'              => 'PHPPDO',
                'connectionString'      => 'mssql:Server=primary.qsibanking.com:1189;Database=qsilive',          
                'username'              => 'CustomerConnect',
                'password'              => 'letmein',
                'charset'               => 'utf8',
                'schemaCachingDuration' => 3000,     
            ),
			/*
            'db' => array(
                'connectionString'      => 'mysql:host=localhost;dbname=customerconnect',
                'emulatePrepare'        => true,
                'username'              => 'customerconnect',
                'password'              => 'dbCust0m3rC0nn3ct',
                'charset'               => 'utf8',
                'schemaCachingDuration' => 3000
            ),
			*/
            'db' => array(
                'connectionString'      => 'mysql:host=localhost;dbname=customerconnect',
                'emulatePrepare'        => true,
                'username'              => 'root',
                'password'              => '',
                'charset'               => 'utf8',
                'schemaCachingDuration' => 3000
            ),
            'dbqb' => array(
                'connectionString'      => 'mysql:host=localhost;dbname=cc_quickbooks',
                'emulatePrepare'        => true,
                'username'              => 'customerconnect',
                'password'              => 'dbCust0m3rC0nn3ct',
                'charset'               => 'utf8',
                'class'                 => 'CDbConnection',
                'schemaCachingDuration' => 3000
            ),
            'errorHandler' => array(
                // use 'site/error' action to display errors
                'errorAction' => 'site/error',
            ),
//            'cache'=>array(
//                'class'=>'CApcCache'
//            ),
            'log' => array(
                'class' => 'CLogRouter',
                'routes' => array(
                    array(
                        'class'     => 'CFileLogRoute',
                        'levels'    => 'error, warning',
                    ),
                // uncomment the following to show log messages on web pages
                /*
                  array(
                  'class'=>'CWebLogRoute',
                  ),
                 */
                ),
            ),
        ),
        // application-level parameters that can be accessed
        // using Yii::app()->params['paramName']
        'params' => array(
            // this is used in contact page
            'adminEmail'    => 'david.tran@bonzahouse.com',
            'emailPassword' => 'HGy>dg9<',
            'noImage'       => 'images/noimage.jpg',
            'encryptKey'    => '123'
        ),
		'onBeginRequest'=>create_function('$event', 'return ob_start("ob_gzhandler");'),
        'onEndRequest'=>create_function('$event', 'return ob_end_flush();'),
    );

    
